package gva_intelligent_form

import (
	"context"

	"github.com/flipped-aurora/gin-vue-admin/server/global"
	"github.com/flipped-aurora/gin-vue-admin/server/plugin/gva_intelligent_form/initialize"
	interfaces "github.com/flipped-aurora/gin-vue-admin/server/utils/plugin/v2"
	"github.com/gin-gonic/gin"
)

var _ interfaces.Plugin = (*plugin)(nil)

var Plugin = new(plugin)

type plugin struct{}

func (p *plugin) Register(group *gin.Engine) {
	ctx := context.Background()
	global.GVA_LOG.Info("gva_intelligent_form plugin init")
	// 初始化数据库表
	initialize.Gorm(ctx)
	// 注册API接口
	initialize.Api(ctx)
	// 注册菜单
	initialize.Menu(ctx)
	// 注册路由
	initialize.Router(group)
}
